﻿package mortal.game.view.copy.groupCopy.item
{
    import Message.DB.Tables.*;
    import mortal.component.gconst.*;
    import mortal.game.cache.*;
    import mortal.game.view.copy.groupCopy.data.*;

    public class DefenseSingleCopyCell extends GroupCopyMapBaseCell
    {

        public function DefenseSingleCopyCell()
        {
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            _selectBg.width = 289;
            return;
        }// end function

        override public function set data(param1:Object) : void
        {
            var _loc_2:int = 0;
            _loc_2 = Cache.instance.role.entityInfo.level;
            _tcopy = param1.tCopy;
            _mapIcon.bitmapData = null;
            _mapIcon.imgUrl = "defenseSingleIcon_" + _tcopy.enterMinLevel + ".png";
            if (_tcopy.enterMinLevel != 120)
            {
                _title.imgUrl = this.getMapName(_tcopy);
            }
            if (_tcopy.enterMinLevel <= _loc_2 && _loc_2 <= _tcopy.enterMaxLevel)
            {
                if (GroupCopyUtil.isLowerDiffPassByCode(_tcopy.code))
                {
                    this.filters = [];
                }
                else
                {
                    this.filters = [FilterConst.colorFilter2];
                }
            }
            else
            {
                this.filters = [FilterConst.colorFilter2];
            }
            return;
        }// end function

        private function getMapName(param1:TCopy) : String
        {
            var _loc_2:* = DefenseInfo.getLvAndDifByCode(param1.code);
            var _loc_3:String = "";
            if (_loc_2)
            {
                _loc_3 = "defenseSingleName_" + param1.enterMinLevel + "_" + (_loc_2[1] + 1) + ".png";
            }
            else
            {
                _loc_3 = "defenseSingleName_" + param1.enterMinLevel + ".png";
            }
            return _loc_3;
        }// end function

    }
}
